<!--
 * @Description: 
 * @Author: 老五 13521685612@163.com
 * @Date: 2024-11-05 20:50:44
 * @LastEditors: 老五 13521685612@163.com
 * @LastEditTime: 2024-11-17 21:27:10
 * @FilePath: /lieshou-app/components/z-nav.vue
-->

<template>
	<view class="nav-box">
		<!-- 我的学籍 -->
		<uni-nav-bar @clickLeft='getBack' fixed="true" :left-icon="showBack?'left':''" :title="title" statusBar='true'
			:border="false"></uni-nav-bar>
	</view>
</template>

<script>
	export default {
		props: ['title', 'showBack', 'showBg'],
		name: "z-nav",
		data() {
			return {

			};
		},
		methods: {
			getBack() {
				let pages = getCurrentPages();
				let currentPage = pages[pages.length - 1]; // 当前页面对象
				let prevpage = pages[pages.length - 2]; //上一个页面对象
				if (prevpage && prevpage.route) {
					uni.navigateBack()
				} else {
					uni.reLaunch({
						url: "/pages/service_center"
					})
				}
			}
		}
	}
</script>

<style lang="scss">

</style>